import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ty_smart_watch/page/sport/dashboard.dart';
import 'package:ty_smart_watch/page/sport/sport_grid.dart';
import 'package:ty_smart_watch/page/sport/sport_mode_title.dart';
import 'package:ty_smart_watch/route/routes.dart';

/// 运动健康页面
///

class SportHealthPage extends StatelessWidget {
  const SportHealthPage({super.key});

  @override
  Widget build(BuildContext context) {
    return PopScope(
      canPop: false,
      onPopInvoked: (bool didPop) {
        if (didPop) {
          return; // really exit
        } else {
          Get.offNamedUntil(Routes.initial, (route) => false);
        }
      },
      child: Scaffold(
        body: Container(
          margin: const EdgeInsets.fromLTRB(10, 20, 10, 0),
          child: ListView(
            children: const [
              DashBoard(),
              SizedBox(height: 10),
              SportModeTitle(),
              SizedBox(height: 10),
              SportGrid()
            ],
          ),
        ),
      ),
    );
  }
}
